package com.lxy.aimin.drug.service.impl;

import com.lxy.aimin.drug.entity.TDrug;
import com.lxy.aimin.drug.mapper.TDrugMapper;
import com.lxy.aimin.drug.service.TDrugService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 药品表，用于存储具体药品的信息和库存状态 服务实现类
 * </p>
 *
 * @author lxy
 * @since 2025-07-01
 */
@Service
public class TDrugServiceImpl extends ServiceImpl<TDrugMapper, TDrug> implements TDrugService {


    @Autowired
    TDrugMapper tDrugMapper;

    @Cacheable(value = "drugList", key = "#id")
    @Override
    public TDrug getById(Integer id) {
        return tDrugMapper.selectById(id);
    }
}
